<template>
  <el-table
    :data="logs"
    style="width: 100%"
    :default-sort = "{prop: 'username', order: 'ascending'}"
    >
    <!-- :default-sort设置默认的排序列和排序方式orderdescending 默认是ascending -->
    <el-table-column
      align="center"
      prop="username"
      label="登入账户"
      sortable
      width="180">
    </el-table-column>
    <el-table-column
      align="center"
      prop="lastLogin.ip"
      label="上次登入ip"
      sortable
      width="180">
    </el-table-column>
    <el-table-column
      align="center"
      prop="lastLogin.loginTime"
      label="上次登入时间"
      sortable
      >
    </el-table-column>
     <el-table-column
      align="center"
      prop="nowLogin.ip"
      label="本次登入ip"
      sortable
      >
    </el-table-column>
     <el-table-column
      align="center"
      prop="nowLogin.loginTime"
      label="本次登入时间"
      sortable
      >
    </el-table-column>
  </el-table>
</template>
<script>
    import * as Usersapi from "../../../api/users"
    export default{
        created () {
            Usersapi.getLoginLogApi().then(res=>{
                // console.log(res.data);
                this.logs=res.data.data
            })
        },
        data () {
            return {
                logs:[]
            }
        }
    }
</script>